Skip to content

fix(prompts): arrow-key navigation no longer duplicates selection options - #16

Merged
bhagyamudgal merged 1 commit into
mainfrom
t3code/fix-editor-select-down-arrow
Sep 5, 2026
Merged

fix(prompts): arrow-key navigation no longer duplicates selection options#16
bhagyamudgal merged 1 commit into
mainfrom
t3code/fix-editor-select-down-arrow

Conversation

@bhagyamudgal

@bhagyamudgal bhagyamudgal commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Choosing from an interactive list (the editor picker in open, the worktree picker, the setup prompts) left stale rows on screen as soon as you moved with the arrow keys, so options appeared two or three times and it was unclear what was selected. I traced it to the select renderer in @clack/prompts 0.x, which upstream fixed in 1.x with no backport planned, and upgraded the dependency to 1.7.0 with the small type adaptation its narrower validate signature required.

What changed

  • Interactive lists re-render cleanly while navigating with the arrow keys, one row per option
  • The setup text prompts keep the same validation behavior under the new library types
  • Added a patch changeset so the release notes pick the fix up

How to verify

  • bun run typecheck, bun run lint, and bun run format:check all pass; bun test reports 96 pass, 0 fail
  • Drove the editor picker in a PTY with DOWN, DOWN, ENTER at 30 and 100 columns: 0.9.1 left a stale duplicate row on the final screen, 1.7.0 shows each option once and returns the highlighted choice
  • CI runs this same lint, format, typecheck, and test suite against this PR

Summary by CodeRabbit

  • Bug Fixes
    • Interactive selection lists no longer duplicate options when navigating with arrow keys.
    • Setup prompts now handle empty or unexpected input safely without throwing errors.
  • Chores
    • Updated the interactive prompt experience to a newer version for improved reliability.

The 0.x @clack/prompts select renderer leaves stale option rows on screen
when moving with the arrow keys, so the editor and worktree pickers showed
repeated entries. Upstream fixed the renderer in 1.x with no backport, so
move to @clack/prompts 1.7 and adapt the two text validators to its
narrower value type.
@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 378ab44

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
worktree-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 276952b8-9fe9-498d-948f-2bf67fa2cdd5

📥 Commits

Reviewing files that changed from the base of the PR and between f884b17 and 378ab44.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .changeset/tidy-pandas-repeat.md
  • package.json
  • src/commands/setup.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change upgrades @clack/prompts to 1.7.0, adds a patch changeset, and prevents setup prompt validators from throwing when they receive nullish values.

Changes

Setup prompt updates

Layer / File(s) Summary
Prompt dependency and release declaration
.changeset/tidy-pandas-repeat.md, package.json
The project upgrades @clack/prompts from ^0.9 to ^1.7.0 and declares a patch release for the duplicated-option fix.
Setup prompt validation guards
src/commands/setup.ts
The base-branch and worktree-directory validators coalesce nullish input to an empty string before trimming.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 378ab

This updates interactive prompts to prevent duplicated list options and makes setup validation tolerate nullish values without changing required-field or directory validation behavior. The change is ready to merge.

Poem

A rabbit hops through prompts so bright
Arrow keys now keep lists just right
Nullish values meet an empty string
Safe validators make ears sing
A patch release follows in flight

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing duplicated selection options during arrow-key navigation in interactive prompts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/fix-editor-select-down-arrow

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes in 378ab44, covering the prompt dependency upgrade, its type adaptation, and release metadata.

  • Prompt rendering fix: Upgrades @clack/prompts from 0.9.1 to 1.7.0 and updates the lockfile to use the corresponding 1.x core implementation.
  • Validator compatibility: Handles the 1.x text validator’s optional input while preserving the existing base-branch and directory validation behavior.
  • Release metadata: Adds a patch changeset describing the interactive selection fix.

Pullfrog  | View workflow run | Using GPT Sol𝕏

@bhagyamudgal
bhagyamudgal merged commit cd2c0a7 into main Sep 5, 2026
3 checks passed
@bhagyamudgal
bhagyamudgal deleted the t3code/fix-editor-select-down-arrow branch September 5, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant